class SingletonBase(object):
    __instances = {}
    
    def __new__(cls, *args, **kw):
        if not cls.__instances.has_key(cls):
            cls.__instances[cls] = super(SingletonBase, cls).__new__(cls, *args, **kw)
        return cls.__instances[cls]
